home *** CD-ROM | disk | FTP | other *** search
/ fxPAINT 1.0 / fxPAINT 1.0.iso / developers / plugins / includes / fxpaint / fxpaint_api.c next >
Encoding:
C/C++ Source or Header  |  1999-09-05  |  2.3 KB  |  45 lines

  1. /* fxPAINT API functions
  2.    ©1999 by Felix Schwarz / Innovative
  3.    All rights reserved.
  4. */
  5.  
  6. #ifndef _fxplugin_c
  7. #define _fxplugin_c 1
  8.  
  9. /* Define functions locally
  10.    This macro IS the most important of the whole library. Don`t modify it,
  11.    AND: Don`t use Alloc#? or Free#? of exec.library for memory-allocation
  12.    for space used by fxPAINT!! This is due to the fact, that fxPAINT
  13.    supports the PPC. Please use CstAllocVec and CstFreeVec instead! To
  14.    avoid any problems, try to always use CstAllocVec and CstFreeVec.
  15.  
  16.    How to use this macro with seperate functions:
  17.    · Pass a pointer to the PluginInit-Structure to your function
  18.    · Call this macro INSIDE the function
  19.  
  20.    For Hooks
  21.    · Define a global variable (not recommended, as the plugin can be
  22.      used by more than one program (e.g. several started fxPAINTs) or
  23.      expunged (loss or modification of global variable -> crash!).
  24.  
  25.      If your plugin is designed to be only used by one task, simply don`t
  26.      let your plugin be opened more than one time (watch the LibCnt) and
  27.      take care, that the LibCnt can`t be expunged, if you define a hook!
  28.      (else: Crash!)
  29.  
  30.    · You might want to use a special construction with ports and the
  31.      pointer to the struct attached to it.
  32.  
  33. */
  34.  
  35. #define initfunc(plg) struct PluginInit *fxPLUGIN_init=(plg);\
  36.   struct Gadget * (* gui_crflexgad) (struct Gadget **glistptr, long winid, long x, long y, long border, long wid, ... ) = fxPLUGIN_init->gui_crflexgad;\
  37.   struct Window * (* gui_openfix) (char *title, ULONG idcmp, long id, long x, long y, long addwid, long addhei) = fxPLUGIN_init->gui_openfix;\
  38.   void (* gui_drboxsel)   (long id, long x, long y, long w, long h) = fxPLUGIN_init->gui_drboxsel;\
  39.   BOOL (* fxp_drawfsb)       (struct Window *win, struct Screen *scr, struct fsbitmap *fsb, long xpos, long ypos) = fxPLUGIN_init->fxp_drawfsb;\
  40.   BOOL (* fxp_drawscaledfsb) (struct Window *win, struct Screen *scr, struct fsbitmap *fsb, long xpos, long ypos, long wid, long hei) = fxPLUGIN_init->fxp_drawscaledfsb;\
  41.   BOOL (* fxp_drawfitfsb)    (struct Window *win, struct Screen *scr, struct fsbitmap *fsb, long xpos, long ypos, long wid, long hei) = fxPLUGIN_init->fxp_drawfitfsb;\
  42.   ULONG (* fxpaint_api) (long mode, ULONG attr, ULONG value, ULONG value2, ULONG value3, ULONG value4) = fxPLUGIN_init->fxpaint_api\
  43.  
  44. #endif
  45.